def wise_speak(sentence: str) -> str:
    words = ["have", "must", "are", "will", "can"]
    for word in words:
        if word in sentence:
            i = sentence.index(word)
            part1 = sentence[:i+len(word)].strip()
            part2 = sentence[i+len(word)+1: -1].strip()
            return part2.capitalize() + ', ' + part1.lower() + sentence[-1]


if __name__ == "__main__":
    print(wise_speak("You must speak wisely."))